<template>
	<view class="center">
		<u-navbar title="收款码" safeAreaInsetTop fixed placeholder>
			<view class="coreshop-navbar-left-slot" slot="left">
				<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
			</view>
			<view slot="right">
			</view>
		</u-navbar>
		<u--image :showLoading="true" :src="qrc" width="260" height="260"></u--image>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				pages: null,
				qrc: '',
				searchData: {
					id: null,
					type: ''
				}
			}
		},
		onLoad(opt) {
			console.log('ssa', opt)
			this.searchData = {
				orderId: opt.id,
				orderType: Number(opt.orderType)
			}
			if(opt.pages){
				this.pages = opt.pages
			}
			this.getQrc()
		},
		methods: {
			goNavigateBack(){
				let that = this
				if(this.pages){
					uni.redirectTo({ url: that.pages, })
				}else {
					uni.navigateBack()
				}
			},
			getQrc(){
				this.$reqJsonPost('GetOrderQrCode',this.searchData).then(res=>{
					this.qrc = res.data.data
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.center{
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100vh;
		background-color: #fff;
	}
</style>